{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "from lxml import etree\n",
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "当前请求的链接是： http://angelimg.spbeen.com/ang/10200/1\n",
      "当前请求的链接是： http://angelimg.spbeen.com/ang/10200/2\n",
      "当前请求的链接是： http://angelimg.spbeen.com/ang/10200/3\n",
      "当前请求的链接是： http://angelimg.spbeen.com/ang/10200/4\n",
      "当前请求的链接是： http://angelimg.spbeen.com/ang/10200/5\n",
      "当前请求的链接是： http://angelimg.spbeen.com/ang/10200/6\n",
      "当前请求的链接是： http://angelimg.spbeen.com/ang/10200/7\n",
      "当前请求的链接是： http://angelimg.spbeen.com/ang/10200/8\n",
      "当前请求的链接是： http://angelimg.spbeen.com/ang/10200/9\n",
      "当前请求的链接是： http://angelimg.spbeen.com/ang/10200/10\n",
      "当前列表的链接内容为： ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']\n",
      "当前图片链接的列表内容为： ['http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/kJf25S4UxYP5M4KYOOQp279596-rDZqGt.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/gFCLZwYNhrbYGRYzCdFd279596-F8T14O.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/29oFLJthDqrdiMB14cQP279596-PRsrPV.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/KMdnhYZ1b0M0YPd1Zwts279596-Mj8L20.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/UOh0cBkLmWJOZTCxQl8h279596-Aqj2cf.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/kJf25S4UxYP5M4KYOOQp279596-rDZqGt.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/gFCLZwYNhrbYGRYzCdFd279596-F8T14O.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/29oFLJthDqrdiMB14cQP279596-PRsrPV.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/KMdnhYZ1b0M0YPd1Zwts279596-Mj8L20.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/UOh0cBkLmWJOZTCxQl8h279596-Aqj2cf.jpg']\n",
      "当前全部图片的列表内容为： ['http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/kJf25S4UxYP5M4KYOOQp279596-rDZqGt.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/NaO5k7OmAJGE0ljnSzdP280777/j7QRFITx9054xJv8hjpx280777-mJ7SdA.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/YWRTRWUuu12W1Q86GZe6274348/RZwToNXKPWVbggoDEv8d274348-nwWH89.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/dhCzX1SaWAYinXdoW0bx278690/RGiGjq18lzyTllBq0nYc278690-QAdq7m.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/3hFAJ2NIDWYDZ41h4gxv281633/x0adaNEbDGvUjzOKY5T2281633-QtRbjp.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/hf6HL9Uy9wGkiJ6ETxSx272584/nI0DnB4AdBE5bI27L8gF272584-DoBxv8.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/5wJQd9G5YbZSA1q73dGP280567/s4T5ktk2qcHAFuwy5zM5280567-BR2uD0.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/RBYXUxhQjay9qkGp27o3282396/MS8mIYcMZvklz1BrkllS282396-5wG7Sk.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/lTL9GhY15WE28nGfuTgB281095/ECmNiB9PdlFwMnelSfbC281095-FAjkZG.png', 'http://image.angelimg.spbeen.com/00000mx00000/bNcRUXCJLIM3n4gHiuOD279961/ov251lfdYTqwyxPyCzYP279961-mxsvk6.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/vpHcSqQ8TaNMdVGp6xhS304677/JeorfEnV21HyEDlOS3tA304677-PVeMqb.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/I9x3rGOiqTuHYJmpltXW284840/5IbfgeHpvXU8MhoudYU1284840-ju0x9j.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/rlOLUZpBWyYE78F2Lbud301683/w98xFyrQWrKvhxd5y1axeTHDgr.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/KT62kNaBpWoOMq475trJ294979/1sa8xuekXepYvTMddbLu294979-DWCUKh.jpg', '', 'http://image.angelimg.spbeen.com/00000mx00000/oxBibzrtv4Ot9rEB8ihC54381/N0hP8MsJTdPsiXSGBulH54381-4d0NP0p.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/j8c5nsEWTP3GcCrVHFQp281465/6XUwvBHYU2PpRmOBtKzh281465-OPfigj.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/uRLc3YIIaCYozxwyCHFl297054/fQAWCYlNOTmni54jwRWE297054-mjyLBc.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/ntbICWc07GIjCzRZd0Tx307660/N4GW0IdtZcr3q9gpzPoPdfeb2f416e684ade9bcdb86157e74e77.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/gFCLZwYNhrbYGRYzCdFd279596-F8T14O.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/k9Xs2WzvOuAbEi7b53HP279431/K22AX5Hrefxbgvi3hawz279431-L5MRhp.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/LiGloCnxedkOeEubiTKX301712/pYA5PdM0Zms0nUaZC8Z0q282WE.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/B1T2euBBSxz43rSX3Wxj301903/Jf9dKkhJjYUfdPXBqNGl301903-Deu3DG.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/0M7RkVbvPdul8Sxq886W307564/TFFwl9SoKVZxjYfMakMV2edd777826b69b3e89b23a6c9a6cb8c2.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/E5sKCANmUZ6XdMahNMRB300612/Rv1giXpRm049pSZq4iJN300612-qwL9W4.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/u4ZysawaFOwDCFH1lVih287922/aolvguGEmiZgREB1LYOl287922-Blmwyk.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/rcSeIVJhOVaQFRYKLa28281647/kIgfKa1t9CDU3aw2X1Am281647-55l73D.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/ZAELyOjpPxlwSwnOygUp274704/YX54ZawvBXmoKUVPKZJr274704-oMCCzw.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/jdZrqryDhP346ERoL65z273963/k8l6ybDbCbjdHIASiLeu273963-fAvlcS.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/TBuYKdBHWZLo7VEE3uWV296465/SSG9xvA3dq6QPGahcYx9P9xbji.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/0co8pjqwC8G6QqlBV3aq304870/k1ije99xXJlvjLSCmhjZ304870-lTKjsF.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/2RZuuQ7mCFHWaOVyW7kN281088/6gYomC8TZC4C5jAZsfSH281088-takKOz.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/11Caoj8pSdljxzO3eRLN291403/Ug0Tf086jETQx82qHt5H291403-C2cCyA.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/VkjaqZAmmZawAkS5YhcX295440/JxK4f8xTrm0WD0TisVtUhdzKbn.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/JvMCeclXUjMYjzwTPVhP303969/3F9Eix24ip4li2Y3SBwK303969-Cg9qXr.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/IJC9kxzIyJdJYCVDtyyJ291830/HRXbSml6UHsrzk7nRTyO291830-5dQBfH.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/LmeHsmr4VDHgHXU0rzgz305828/i7rkas05QHXkqFjwHPo5305828-6RJZaW.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/Z9W3KeKzEhRlovNtpvV8277196/fHj9Aham7Ehs7zM5WZRT277196-uH6uwp.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/29oFLJthDqrdiMB14cQP279596-PRsrPV.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/YMeOyGrpYM5sqRyXpvEd304507/h7dNlsg66tmRdCWQa58K304507-rLQ5bz.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/l8lOSGgcrbBtap49tQ0l303941/0yZCqrtc7a75P77gL8PTC5O34O.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/dUzlvEtZI7oh6C6Ec3eu305843/Q0Bex1G5XVs56aCgQ5mi305843-Hl9zGp.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/KuF1RLLB1zN0TXEmTGlT306376/80ZLjC43TgYaKnGulBwL306376-Z2zN0f.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/bz2AXwGlAHKCtSoc6ixT281908/oa2wETagDAqrc0kfs1Tw281908-8CkIBM.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/aj0xmVAXEGyQn0Hgr9IM306527/YjAqrKCxmMMBLN8Feo38306527-lyGnYc.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/Ma7fdqo5KxobSIdL989f274435/dBgWbZB0KrOJOB2oZ1FM274435-SmTBQW.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/EuDVJ7r42JLJCfRNT3Ot288545/W0tdY5tCksq5ZtakHP9w288545-PEEDUh.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/u7rdJbx8tfqNzC0ECwkb275795/nq8jrPArBD2pgOomIUC2275795-iqDSpN.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/elZ2JvFYnry2rM9We3eA305054/dTqYYGrDPXMwVFjoRcLo305054-lTXAxd.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/hs5qMRoKBwnsYYiP0SQJ280731/hZqEzWKCZq0Y4KIcHICH280731-tysrOM.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/0bszg0MNWSOkJDAoOs1O276754/Sqn76ODY4TqrCOQAEUj1276754-4Nwiby.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/0xKJjntCChrTlGt7LEJ5286019/28VeQCBzcxBA7aRtjAPr08-286019-7WdIHz.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/FYsVu5dnjbEpiBmRjgJn283118/HgN51g8H9GQFDiWMjJyp283118-g11iHJ.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/ZTCfERtsuGGUIYQOIwrg294594/WgW2puwYbQegX2e7gwY5294594-eLFk6Y.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/bXXldhCw3ErsGcYiSvEG301835/Z2Jh9QSIvR5ex6LCtYmYbQVmQN.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/rQN0TzKz0XKvOfMk06JA296276/ti35hfObcYEqqqPPqzMbP9sX1P.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/tXmMjtoPow799NioaUXr289995/30XVBjOIm0xBEGSloKyT289995-JSjCP0.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/KMdnhYZ1b0M0YPd1Zwts279596-Mj8L20.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/aP64ULLSVSe9sDK1uGq2276963/PRyyTLxB1NWiBnEMHDel276963-PksbHC.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/kOeYxWLfB1kjW7OEfpQu300161/WsNvP9zIhyyctc4iVfIH300161-ZIwoIY.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/hEmBfSjUsPsWahyc3Gt6300153/a1XHfm5oykLV5rYI4BCY300153-mtYvIi.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/ls9r5E62eGrCNKNMCCFI300497/1vGz3776jSkHJ2x2JkHh300497-5gKJu7.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/kk2S1R3SJpiVXPvlfC1W278234/jF38urh5iaf31Zb9QzmL278234-DXREhD.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/fR7dN3sdSjwKLxAVWukJ281581/VQfVumg2flUByKryDNbe281581-JaCXSM.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/95PIS1oBuTf8GrQHGI6A280125/hWCRgcXGp6zUby9rFu8e280125-B3zcXG.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/jJzeU3jyiMZzX2iAznuH307091/H3S8SIlQEAq5tqumZr2c307091-QpPkZh.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/CFHFCusXWgyvqAH3vART304656/h90cH471FxEh20WZGdBd304656-yEfQop.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WKl4byMpGq1LWgrcOAMz298838/VgvvhscyEC09kH7kNwFm1jFIqm.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/O3NGx3fBFxzA0WkOUML3298524/JnRxeRvmtp0QMZM5Gh36E3b2cx.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/Ulpe52Ou30e1RkVUaWqX280511/In1LSR4snBoAOgU89IhB280511-LvOICd.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/uIKJ9mqRJ3TxbzgG1mXB307407/Pmg80MSp34dOwkvxEDQl23c365ecaa5a6b18873fe103801c4b5f.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/EvyLLm9NdqWjibOByPHt306448/8JFSLqGBMmygRDLpvxU4306448-Fr4VMJ.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/Fbj6LNNOwE5tNNgOZLxu297135/yB8Pa88Vi9kZuanBobnp297135-EbQnXi.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/hok4u3JNMi2DyP3BTNLh287456/oouSDwlE1CTWF16j8Awk287456-0kfhqg.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/G7A3kmOoSJ9s1plJrLle305152/9tWccpKzqKZ5bq9ud1Hy305152-zuc4SR.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/OF8cmEKGiyqPRd6Ixtgz304838/V2RxQDs7M86bRx6SAZ58JHYj8T.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/UOh0cBkLmWJOZTCxQl8h279596-Aqj2cf.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/Dxjwf4OVTNyBG5141JfS304662/KWHfyLFChSghK4L8XGZz304662-xpnjUk.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/QF6cYTGzrfnCjjeK90pE294995/Qh2o9AyKoz4jxuxbd5MSZREjD4.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/K72bdfNVoTa1lkrSf5ED284625/5qNGjgLJQQMMAJ6Crf1l284625-sEk8Vd.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/XS7MmzuT4iwvGy6YoU20290856/9oRP8W4V7viP2UMD0qoz290856-JlCp2G.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/vHtvDGSFhm5CTqQjBZNc52005/DJ9ghW81yX6o3EcjgMKp52005-0wsKisl.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/rmF4FGReGmOUchLy8A7J295260/t2XlmZZkHvn6fY0r0BoL295260-kEdgqT.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/i6PB3yDTBe8m5mrvvASD274986/8ITXEMTX9rDA8bKHTHkz274986-a2zpjK.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/nIlP2Y0GnsDXQ5xJPchR279200/YrhffiWhs31jhnAaRake279200-eEiLES.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/62JP6poHAas78eHUkina277227/Z4dZ4GWa3ClgaYIXzc21277227-1CR244.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/d3idRlMl6vUjyYcixmwR290324/vX5DkHPL1vGQtYE1Ylza290324-uDoaMr.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/2RZuuQ7mCFHWaOVyW7kN281088/6gYomC8TZC4C5jAZsfSH281088-takKOz.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/MOeyACZDxaUw2x4Dh5Ah277103/NiAYRK1NBcelTvT6I7HU277103-1K6AG1.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/PWJ6dkyazKPA0aGYUPzE286549/DQUANK6O7vLSXMwPcW9h21-286549-wxRy7C.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/Q4jwdfGsjkXAPqFtVaHX305031/dlvWifq2gYFV4zOgO7ok305031-tzqp4J.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/HHL1izfjyRlKYHPuH2JB290107/ECenxhEzTPtMWHlHzUaK290107-uNfLTL.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/SlKxyHRxb1MkgaO18RIZ290086/z55fQBIdv2HLNFQCmQX7290086-toyV69.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/ikrqhSC9FyNYRQyxbyk0275780/GXupYKxT1oLQfwPkYEhA275780-Ew8suR.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/ppDoZ7Br8G9hBqBgd0LP307283/j2O1lu2WZDsW71Xxb3Ln7bde2650404ce55c4c929a5c4e44bf0f.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/kJf25S4UxYP5M4KYOOQp279596-rDZqGt.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/1sQyKpiDpy8CcShc943S307544/gXVC6MMI6Kaj40KDghUM5983f975a08266df583a51d2fb4656f9.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/m29hOXVkCKQ4HoBglZZk277257/ob29gIDNfnb2HpOVtCb5277257-jq3r67.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/gHSwHu2A3LfzX5RuEfwM299728/arqEZ5nk9YsrQ8HGIZcj299728-4nR0tN.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/zelnulQHiIiCLj7jDTXo274478/w5rgNNJoLBScTL3zfkUy274478-lT9iA2.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/O5qh1z3Q56dRppCvF4XA298735/PsZBsKskjZWt8WEss9Dj298735-BPaGC1.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/SPZkd6uj25glQNHJ1XzB307415/dv5meCkNSIlpchfn9XGa79accfe45a8d790a7ebded2a491b6598.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/K3yFd2BstKMrrMO0Kaeq278548/ZrwkbUqwhXHw6d2Ir5Sa278548-7RbgSZ.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/wK9Anr3u4v6jjBNlNKoA277521/89xD3d6G1AzZvbCrZsTu277521-eOXCCY.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/qQYX4rAA5lxayHcYDDw8307854/ABudqzVt5g0XBfNSG5Z61980deb1a0d98b458ee9a3585b9d25bd.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/v48N4zQmvvCdErGalulB286139/Qys8xzxg5RhP6QMwwXQd10-286139-qSQJnG.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/vKnbkwCM005hSWEIla4u277877/NeSAWcOWStGNAbxExoUs277877-BQH3aM.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/VEVsQzFIcfW3EPfb7f9j283539/8uS1aDRCYuXxSvjrJeVj283539-qi3BUX.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/lOXgkXtSZywhMK9ytLTm281620/p99gFD8mWGdOGbz8ab62281620-Nju0oE.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/TF3dvgC2Tez5Ja949E12280267/IxSs8J8a1AoJotmVs6eb280267-LbaxTE.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/fMMdDU7UFwWGIwy41KY8307123/68bcUMpy51CAvo7pf22C307123-aYZX9x.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/hY4J145sq0XEntolqOBc276418/JQT8PYrZ21bWnTyzAmCs276418-iMMIHc.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/K8AHZ4xUihese0eYMgU9281514/d47Y6aLdQLFGTVG6actS281514-D4ptpQ.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/JofuE6BFt8yXrgzRmSHE296986/2Yp3fIZqBozR1yaby5zp296986-843glq.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/gFCLZwYNhrbYGRYzCdFd279596-F8T14O.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/SbIfpa2wAoW9ghlda2IW275872/0uo7Jb6xybyUgjxO0Euv275872-Ffrkis.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/H5NHzOL4cAMsEPuSjAGO301028/OS28yqnSwU7PkzjIqChdWMDamD.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/1o81SXd7YwBlZ5xTtxST294932/j8dnUYOjjrBci5NXiRAwMBmC1f.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/zjcotg7bvLmFiNbAzgea300569/hAxPjs5RRCyN32Fe03vw300569-mokPQP.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/sSLsuZmNFh7yDv7prW4K278663/wCk5QQqQN6hiOFYja0rV278663-QChEc3.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/kOsc1eHEacIngXGaTwKA300451/SGPwVcbUqetcevlnMlEOvOkkI1.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/iKX7SsYiXLmFst11iMuK290975/grdFmhHHHKveKevpxF6q290975-d9VPez.png', 'http://image.angelimg.spbeen.com/00000mx00000/ZKba1yRtGYGdMkl8Du2i305381/N8HiGoPNrI9foOQ64Yu3305381-Cx5l3S.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/B0WzdqSrLNAqLXisIVaE279350/fD9Kms0D8KjjZoeOGZ4g279350-fhxX9e.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/q3j9L18lZ3WGQWGVZtcM279646/pi9alL6cnqk7IB235CaC279646-x8aVUJ.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/AMuPvgkVoBY0d3yj5or0306426/RKQtarqA1VWRNPAqjjB3306426-Tt527x.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/uuMJEYwGZMYtmUNJo4yA297172/8qi3J2LYDrWTJC7BGDOQ297172-KfnafX.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/HXUtGiKDfVYgmtKohnX0278907/mhoD1x86Xcdy1pgLi97Y278907-LNEfDn.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/ucAak3Ldtm9gKxpPxbWd283122/ab5UW9rS30dO9aNWB36p283122-LT1rCE.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/HXEAbGFSPj2fwqXGckBc276111/WvnY6r79k20kYACZibi6276111-SB56dw.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/I5qmZIeZhNag0IwqWwBs300759/Dc9qdPaMKnDG5POT9EyG300759-pKYwzY.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/7HwtgQXsCMLt72KwrH2V302907/kNy787xWHIJPwhlTx4U1302907-JRqSvF.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/t2n49vNSeYbFUW0xxHpU275551/X1nvdOcggyDNmhSLJ6gL275551-KMZRNd.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/29oFLJthDqrdiMB14cQP279596-PRsrPV.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/bdUzVtabJBi3n5a85ZaL307259/zrkDgdmnww08l2DicmHa3ec5515bb32fc1e1ecdf184437669721.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/dfDXNDmn5PXIGbGxy41u306390/OkXFRsuU0rhezQXefP7l306390-Sm7fuQ.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/EQFWAcKMq98g1GgBuVDo280077/PhQLwdEfO0D6bIldOuga280077-x4Kf3Y.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/TZaBs0MO53FIJyQJKbUo275139/P5RA8o9EJmKysD3eAUjT275139-wHy98T.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/XjY8l7mahK1VS3rMlOv8276184/xmsi8wqMpngscTGvKkG3276184-TRTwL3.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/F53k68LqDuGW3A5Yer5M289707/gk3H6T7SuDSWcqc5e7DX289707-D3FoOR.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/m32jqEthNjy3GjHhwYCh305827/8RjwEB88DddxVX1LEgR6305827-BPl8jr.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/XzC2GsmebrsJ1cWqBDP9284771/1m42NW4sEhjafcZGywC3284771-tMeq3C.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/kIzDzNKGWMMQriLxooN4295167/TUZLjYvAazI0htdMjouD295167-9mQFCO.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/DsW2LdyalC3VISvWrMH452322/pYMgS2fJYZugfRHpSafp52322-8hPbPsN.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/5niSHaEushPgfOMwZyNO298673/xIoABoS6rIvOpdqGz6rDroTBFV.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/Ab5fypCmRdnbwaoIcZoT281030/l4Jr6yYbERRdarsi2ALD281030-AbuPEZ.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/tWDWsYxRfF23GLxX2XEW305870/ePWiZ1i8Y120mebdSyw1305870-TyNmcz.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/wygCNoTAonCHp8rUp2cn304784/BofRsfKqzMgNbXjJugRC304784-BwYAg2.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/di83Sc7EBWrLHYAICAWu298600/laLjvCCfM1Swx7FqvUwUbqnhxe.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/kxkYTSW1ttTZ9cXpCZFk306863/FmpPzK65VNcA017LrYpv306863-EpSbAx.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/xnFkkNgMPBeXyl12ZfNN287041/9ENK0MD6q213fMnsEscd287041-j2po5C.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/Xs3MNcAuOPRF2E1eQkud277176/rfvK8wcRrMkhf2rEa3Ic277176-rFoaJ4.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/KMdnhYZ1b0M0YPd1Zwts279596-Mj8L20.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/txP7MXJjiitcat8KGSAi275893/TfbGi0c4zgtJI6eQLrlN275893-pfwrZB.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/NKun09uCaaC6YqdHmKxR292493/DrGnGyoD31AIe80EXyvG292493-lEl210.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/7Gy3c7mo3f6jnrr8cijt307560/Jk74AP9tOojsZYzFW9Soac475611c31a00a12a898a5e2082e887.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/Ccl6xHp8ie8yO1EXpGpg275135/w01ZduuYKcqgCd7Xyna5275135-j3IA0H.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/5E5IToLEmNTC2oChL1oG305424/OKdk6te2fFe2QBXnLoMl305424-GbJOtQ.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/eZbdtD71ltTylcWceeK1278969/r7A0Vv2pj54KwsHnRnQz278969-8OiKab.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/7nq6nHycRd0TZs8wkpWK302434/jn46hyAfqeaNVTBqoheOxDFYiv.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/EwJBRl1qeUsXlIrNeRtH282584/p4clSZeH7VcNT0mCyHT8282584-64ZKOp.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/mKEjB9ezUgvYKnLHMhhI290485/GjhEilDjXhCx9a4fs4cD290485-coIvWv.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/3yIZ2gvxm3RNFuAmfwws307883/cbNFXb8QKZWUcok8nexYe72104068401d7afe369267cae5debe8.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/3IdZRyzLvRyhULLVBtfQ296448/4HZW2jfcrJilFP7yqddD296448-qjDfab.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/JV6KRns84TQgQ2dwum7g277774/r2dA6ypMTlKeTdPQiQhF277774-WfppKy.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/EbpjQwtpSfQaJlArcs3b291480/05Aduh50AZzIjrXbMrPW291480-5ZmSgG.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/aJY9QjefuAwz4rnoekDD279219/kgYCzrUWuc68QqgSsBxo279219-Ll7c0b.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/3G7aksV6Cy9G1B97r6tZ295974/IA4ZEHIjxhvnWRP3ELE3295974-hriC6x.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/qHQSCPA7IFkHUZhP9Fiq296867/bghS0S75aiErUnkdPdHFa2R0mJ.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/CI0dq8DCHK2rqvr9lYsS278478/MiVK8xZ6LNHGuim068kI278478-HoEiIA.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/lo5u6VrTnU5AyzUM16KM277899/nO39zLoWw3HCLUA9McpU277899-2nYOs3.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/UOh0cBkLmWJOZTCxQl8h279596-Aqj2cf.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/wYhvm3CLWo1plhVBirEl306313/wX1DsGDQU8BFWAlrKEYx306313-07ix6l.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/PIzVH7Nx4DlhsiAMHnQF290764/NhVowZl7BAoWJqonyO1f290764-b3Cz84.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/T6QjjDQocb7dEBayUdFs277881/Cp0X1RSOIq1Rirwri1uy277881-Fmasx5.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/KBYd0hG7qIIK1SZnv2UM300038/IEFhwrEnvlYD5ia9ZsalGcUatZ.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/iKX7SsYiXLmFst11iMuK290975/grdFmhHHHKveKevpxF6q290975-d9VPez.png', 'http://image.angelimg.spbeen.com/00000mx00000/kXfV9AUcV6UdHFF2WqSQ280868/0FNCIAbDY1CQZ5ZWhWOd280868-e0AsoM.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/0qI9GTbLlnKUEXxnnSf9297562/sHViZyAEgki7JaQNHCRV8eL731.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/VI6wcqJahmuaxH1qlmsN281957/FYxAwUNUiWaOxwUy4eWR281957-9XTVVf.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/j7nDNzPfdWS47CRrtB7D307235/jpJgT05HZS7sXgvJZGOj307235-Z1hhjH.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/zEamTARhxdZp6YlqExbt279481/PpSDDILxi6GlD8kmcu2u279481-xt9P8Y.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/C60I9NLcSRw7mjKNap3D303484/VOrkVakXfqlVPL7OSC0K303484-Fh7UDR.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/dvxgbho68NEufILdcFpk284527/mMsxDDw90a5HeKZAc3MM284527-61KRDG.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/8Y9valjbSQSXKXBXwjKk295253/561ti59L7HSwaQKjZJ5S295253-qg8ZKK.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/CoOcWQmU0FRAjy1kwQ9M295927/oeR2x7qILvBtCUvxOGtkI9yEux.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/2SB1ujg9JmW3yCYGkDpM301694/Q7Qv3Aamc93gtHq6yc7vHCheRv.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/8YDgAWXxdLC6raUJQvlG303436/kfwHHbNd9XYl753nCIPa303436-ipLC5p.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/BxmhucH7V0NBs6RyAp18306030/kq7yUh7Ylfd8p5oYEZDK306030-NRjA68.jpg', 'http://image.angelimg.spbeen.com/00000mx00000/VefcegLV6OeexVinbBVi303028/qay1yiCiirnYtb2mkhKizFTqbx.jpg']\n",
      "当前标签的列表内容为： ['孙俪最新单曲《感知成长的神奇》MV...【10】']\n"
     ]
    }
   ],
   "source": [
    "url = 'http://angelimg.spbeen.com/ang/10200/1'\n",
    "headers = {\n",
    "    'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36',\n",
    "    'Referer': 'http://angelimg.spbeen.com/'\n",
    "}\n",
    "all_links = [url]\n",
    "img_links = []\n",
    "all_imgs = []\n",
    "title = ''\n",
    "\n",
    "def get_next_links(url):\n",
    "    ## 给定一个链接，返回下一个链接\n",
    "    resp = requests.get(url, headers=headers)\n",
    "    ## 将拿到的响应解析一下，然后就得到了html对象\n",
    "    html = etree.HTML(resp.text)\n",
    "    imgs = html.xpath('.//div[@id=\"content\"]/a/img/@src')\n",
    "    global title\n",
    "    title = html.xpath('.//div[@class=\"article\"]/h2/text()')\n",
    "    all_img = html.xpath('.//img/@src')\n",
    "    all_imgs.extend(all_img)\n",
    "    \n",
    "    img_links.extend(imgs)\n",
    "    next_links = html.xpath('.//div[@id=\"page\"]/a/@href')\n",
    "    for i in next_links:\n",
    "        base_url = 'http://angelimg.spbeen.com'\n",
    "        next_url = base_url + i\n",
    "        if next_url not in all_links:\n",
    "            all_links.append(next_url)\n",
    "\n",
    "for link in all_links:\n",
    "    print('当前请求的链接是：', link)\n",
    "    get_next_links(link)\n",
    "#     time.sleep(1)\n",
    "print('当前列表的链接内容为：', [i.split('/')[-1] for i in all_links])\n",
    "print('当前图片链接的列表内容为：',img_links)\n",
    "print('当前全部图片的列表内容为：',all_imgs)\n",
    "print('当前标签的列表内容为：',title)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/kJf25S4UxYP5M4KYOOQp279596-rDZqGt.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/gFCLZwYNhrbYGRYzCdFd279596-F8T14O.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/29oFLJthDqrdiMB14cQP279596-PRsrPV.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/KMdnhYZ1b0M0YPd1Zwts279596-Mj8L20.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/UOh0cBkLmWJOZTCxQl8h279596-Aqj2cf.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/kJf25S4UxYP5M4KYOOQp279596-rDZqGt.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/gFCLZwYNhrbYGRYzCdFd279596-F8T14O.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/29oFLJthDqrdiMB14cQP279596-PRsrPV.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/KMdnhYZ1b0M0YPd1Zwts279596-Mj8L20.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/UOh0cBkLmWJOZTCxQl8h279596-Aqj2cf.jpg']"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "img_links"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "if not os.path.exists('imgs/img/png'):\n",
    "    os.makedirs('imgs/img/png')\n",
    "\n",
    "## 创建单层文件夹\n",
    "# os.mkdir('img')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "if not os.path.exists('angelimg'):\n",
    "    os.makedirs('angelimg')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<Response [200]>\n",
      "<Response [200]>\n",
      "<Response [200]>\n",
      "<Response [200]>\n",
      "<Response [200]>\n",
      "<Response [200]>\n",
      "<Response [200]>\n",
      "<Response [200]>\n",
      "<Response [200]>\n",
      "<Response [200]>\n"
     ]
    }
   ],
   "source": [
    "## 下载图片\n",
    "for img in img_links:\n",
    "    filename = img.split('/')[-1]\n",
    "    file_path = 'angelimg/' + filename\n",
    "    resp = requests.get(img, headers=headers)\n",
    "    print(resp)\n",
    "    with open(file_path, 'wb') as file:\n",
    "        file.write(resp.content)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 使用set将图片链接去重"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/29oFLJthDqrdiMB14cQP279596-PRsrPV.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/KMdnhYZ1b0M0YPd1Zwts279596-Mj8L20.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/UOh0cBkLmWJOZTCxQl8h279596-Aqj2cf.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/gFCLZwYNhrbYGRYzCdFd279596-F8T14O.jpg',\n",
       " 'http://image.angelimg.spbeen.com/00000mx00000/WFHX20XiomBDye2nguRi279596/kJf25S4UxYP5M4KYOOQp279596-rDZqGt.jpg'}"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "set(img_links)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
